package com.evil.application.pojo.dto.order;

import com.evil.common.application.dto.order.OrderReqDTO;
import com.evil.common.application.enums.order.OrderProcessStatusEnum;
import com.evil.common.application.enums.order.OrderSourceTypeEnum;
import com.evil.common.account.dto.user.UserEnterpriseBaseDTO;
import lombok.Data;
import lombok.EqualsAndHashCode;

import jakarta.validation.Valid;
import jakarta.validation.constraints.NotNull;
import java.util.ArrayList;
import java.util.List;

/**
 * 新建订单 请求实体
 *
 * @author liyang
 * @date 2022-08-08 00:00
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class AddOrderReqDTO extends OrderReqDTO {

    /**
     * 订单id
     */
    private Long orderId;

    /**
     * 订单来源{@link OrderSourceTypeEnum}
     */
    @NotNull(message = "订单来源参数不能为空")
    private Integer orderSourceType;

    /**
     * 流程状态{@link OrderProcessStatusEnum}
     */
    @NotNull(message = "流程状态参数不能为空")
    private Integer orderProcessStatus;

    /**
     * 负责人
     */
    @Valid
    private UserEnterpriseBaseDTO handler;

    /**
     * 记录机器人应用层级
     */
    private List<String> logAppKeys;

    /**
     * 新增结束执行机器人
     */
    private Boolean afterRobot;

    public AddOrderReqDTO() {
        this.afterRobot = true;
        this.logAppKeys = new ArrayList<>();
    }
}
